#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
int a[N];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  vector<int> a;
  a.push_back(1);
  int n = 1;
  int p[6] = {0};
  while (n < 1500) {
    int x = a[p[2]] * 2;
    int y = a[p[3]] * 3;
    int z = a[p[5]] * 5;
    int now = min({x, y, z});
    a.push_back(now);
    n++;
    if (x == now) p[2]++;
    if (y == now) p[3]++;
    if (z == now) p[5]++;
  }
  // The 1500'th ugly number is 859963392.
  cout << "The 1500'th ugly number is " << a[1499] << '.' << endl;
  return 0;
}